export function def(obj, key, value) {
    Object.defineProperty(obj, key, {
        value: value,
        enumerable: false,
        configurable: false,
        writable: true
    })
}

export function hasOwn(obj, key) {
    return Object.prototype.hasOwnProperty.call(obj, key);
}


export function isPlainObject(obj) {
    return Object.prototype.toString.call(obj) === '[object Object]';
}


function makeMap(str) {
    let cache = {};
    str.split(',').map(item => {
        cache[item] = true;
    })
    return function (key) {
        return !!cache[key]
    }
}

export const isReserveTag = makeMap("div,p,span,a,button,input,h1,h2,h3,h4,h5,h6,ul,li");
